//
//  JLArenaViewController.m
//  JL网易彩票progress
//
//  Created by sunjinliang on 15/11/6.
//  Copyright © 2015年 sunjinliang. All rights reserved.
//

#import "JLArenaViewController.h"

@interface JLArenaViewController ()

@end

@implementation JLArenaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   //1设置导航条背景颜色
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"NLArenaNavBar64"] forBarMetrics:UIBarMetricsDefault];
    //添加segmentedcontroller
    NSArray * itemArray=[NSArray arrayWithObjects:@"足球",@"篮球", nil];
    UISegmentedControl * segmentC=[[UISegmentedControl alloc]initWithItems:itemArray];
    //设置frame
    segmentC.frame=CGRectMake(0, 0, 150, 30);
    //设置图片
    [segmentC setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentBG"]forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    [segmentC  setBackgroundImage:[UIImage imageNamed:@"CPArenaSegmentSelectedBG"] forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
    //把segmentedController添加到导航栏上
    self.navigationItem.titleView=segmentC;
    //设置标题文字渲染颜色
    [segmentC setTintColor:[UIColor colorWithRed:18/255.0 green:141/255.0 blue:141/255.0 alpha:1.0]];
    //设置文字富文本属性
    NSMutableDictionary * mu=[NSMutableDictionary dictionary];
    mu[NSForegroundColorAttributeName]=[UIColor whiteColor];
    [segmentC setTitleTextAttributes:mu forState:UIControlStateSelected];
    
    //设置默认选中0
    segmentC.selectedSegmentIndex=0;



}
//给竞技场添加View
-(void)loadView{
    UIImageView * img=[[UIImageView alloc]init];
    img.image=[UIImage imageNamed:@"NLArenaBackground"];
    self.view=img;
}

@end
